using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Extraction
{
    /// <summary>
    /// <para>Extract by Polygon</para>
    /// <para>Extracts the cells of a raster based on a polygon by specifying the polygon's vertices.</para>
    /// <para>通过指定面的折点来提取基于面的栅格的像元。</para>
    /// </summary>    
    [DisplayName("Extract by Polygon")]
    public class ExtractByPolygon : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtractByPolygon()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para>The input raster from which cells will be extracted.</para>
        /// <para>将从中提取像元的输入栅格。</para>
        /// </param>
        /// <param name="_polygon">
        /// <para>Polygon</para>
        /// <para><xdoc>
        ///   <para>A polygon (or polygons) defined by a series of vertices (x,y point coordinates) that identify the area of the input raster to be extracted. The last coordinate of a polygon part should be the same as the first in order to close a polygon.</para>
        ///   <para>When specifying multiple polygons, they must be contiguous. Enter the series of coordinates polygon by polygon. Be sure to close each part by defining the last coordinate the same as the first one.</para>
        ///   <para>The points are in the same map units as the input raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>由一系列折点（x，y 点坐标）定义的面（或多边形），用于标识要提取的输入栅格的区域。多边形零件的最后一个坐标应与第一个坐标相同，以便闭合多边形。</para>
        ///   <para>指定多个多边形时，它们必须是连续的。逐个多边形输入坐标多边形系列。确保通过定义与第一个坐标相同的最后一个坐标来关闭每个零件。</para>
        ///   <para>这些点采用与输入栅格相同的地图单位。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output raster containing the cell values extracted from the input raster.</para>
        /// <para>包含从输入栅格中提取的像元值的输出栅格。</para>
        /// </param>
        public ExtractByPolygon(object _in_raster, List<object> _polygon, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._polygon = _polygon;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Extract by Polygon";

        public override string CallName => "sa.ExtractByPolygon";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _polygon, _out_raster, _extraction_area.GetGPValue()];

        /// <summary>
        /// <para>Input raster</para>
        /// <para>The input raster from which cells will be extracted.</para>
        /// <para>将从中提取像元的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Polygon</para>
        /// <para><xdoc>
        ///   <para>A polygon (or polygons) defined by a series of vertices (x,y point coordinates) that identify the area of the input raster to be extracted. The last coordinate of a polygon part should be the same as the first in order to close a polygon.</para>
        ///   <para>When specifying multiple polygons, they must be contiguous. Enter the series of coordinates polygon by polygon. Be sure to close each part by defining the last coordinate the same as the first one.</para>
        ///   <para>The points are in the same map units as the input raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>由一系列折点（x，y 点坐标）定义的面（或多边形），用于标识要提取的输入栅格的区域。多边形零件的最后一个坐标应与第一个坐标相同，以便闭合多边形。</para>
        ///   <para>指定多个多边形时，它们必须是连续的。逐个多边形输入坐标多边形系列。确保通过定义与第一个坐标相同的最后一个坐标来关闭每个零件。</para>
        ///   <para>这些点采用与输入栅格相同的地图单位。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Polygon")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _polygon { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output raster containing the cell values extracted from the input raster.</para>
        /// <para>包含从输入栅格中提取的像元值的输出栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Extraction area</para>
        /// <para><xdoc>
        ///   <para>Identifies whether to extract cells inside or outside the input polygon.</para>
        ///   <bulletList>
        ///     <bullet_item>Inside—A keyword specifying that only the cells inside the input polygon should be selected and written to the output raster. All cells outside the polygon will receive NoData values on the output raster.</bullet_item><para/>
        ///     <bullet_item>Outside—A keyword specifying that the cells outside the input polygon should be selected and written to the output raster. All cells inside the polygon will receive NoData.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>标识是提取输入面内部还是外部的单元格。</para>
        ///   <bulletList>
        ///     <bullet_item>内部 - 指定仅应选择输入面内的像元并将其写入输出栅格的关键字。面外的所有像元都将在输出栅格上接收 NoData 值。</bullet_item><para/>
        ///     <bullet_item>外部 - 指定应选择输入面外部的像元并将其写入输出栅格的关键字。多边形内的所有像元都将接收 NoData。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extraction area")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _extraction_area_value _extraction_area { get; set; } = _extraction_area_value._INSIDE;

        public enum _extraction_area_value
        {
            /// <summary>
            /// <para>Inside</para>
            /// <para>Inside—A keyword specifying that only the cells inside the input polygon should be selected and written to the output raster. All cells outside the polygon will receive NoData values on the output raster.</para>
            /// <para>内部 - 指定仅应选择输入面内的像元并将其写入输出栅格的关键字。面外的所有像元都将在输出栅格上接收 NoData 值。</para>
            /// </summary>
            [Description("Inside")]
            [GPEnumValue("INSIDE")]
            _INSIDE,

            /// <summary>
            /// <para>Outside</para>
            /// <para>Outside—A keyword specifying that the cells outside the input polygon should be selected and written to the output raster. All cells inside the polygon will receive NoData.</para>
            /// <para>外部 - 指定应选择输入面外部的像元并将其写入输出栅格的关键字。多边形内的所有像元都将接收 NoData。</para>
            /// </summary>
            [Description("Outside")]
            [GPEnumValue("OUTSIDE")]
            _OUTSIDE,

        }

        public ExtractByPolygon SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}